﻿@using QDT.Core
@model QDT.Common.IPagedList<QDT.Core.Members.UserPrize>

<div class="main_title">用户抽奖</div>

<div class="blank5"></div>
<div class="search_row">
	<form name="search" action="@Url.Action("TurnTable")" method="get">	
	    会员编号：<input type="text" class="textbox" name="userid" value="" style="width:100px;"/>
	    会员名称：<input type="text" class="textbox" name="username" value="" style="width:100px;"/>
		状态：<select name="issend">
			<option value="">所有</option>
			<option value="0">未发放</option>
			<option value="1">已发放</option>
		</select>
	    <input type="submit" class="button" value="搜索"/>
	</form>
</div>

<div class="blank5"></div>

<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column =>
        {
            column.CheckBox(x => x.ID);
            column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;text-align: center;");
            column.For(x => Html.ActionLink(x.UserId.ToString(), "Index", "User", new { userid = x.UserId }, "")).Named("会员编号").SortColumnName("UserId");
            column.For(x => Html.ActionLink(x.UserName, "Index", "User", new { userid = x.UserId }, "")).Named("用户名");
            column.For(x => x.PrizeId).Named("奖品编号").SortColumnName("PrizeId");
            column.For(x => x.PrizeName.Contains("红包") ?  "该用户获得" + x.PrizeName : x.PrizeName).Named("奖品名称");
            column.For(x => x.IsSend).Named("是否处理").SortColumnName("IsSend");
            column.For(x => x.CreateTime).Named("中奖日期").HeaderAttributes(style => "width:180px;");
            column.For(x => (x.SendTime.HasValue ? x.SendTime.Value.ToString() : "")).Named("处理时间").HeaderAttributes(style => "width:180px;");
            column.Buttons(btns => btns.Add(x => Html.ActionLink(x.IsSend ? " " : x.PrizeName.Contains("红包") ? "立即发放红包" : "处理", "GivePrize", new { id = x.ID })));
        }).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)
